package com.example.demo.dubbo;

import com.example.demo.po.OperationResult;
import com.example.demo.po.OperatorInfo;
import com.example.demo.po.Order;
import com.example.demo.po.OrderDetail;

import java.util.List;

public interface OrderDubboService {
    Order getById(Long id);

    List<Order> getByUserId(Long userId);

    List<Order> getAll();

    boolean create(Order order);

    boolean update(Order order);

    boolean deleteById(Long id);

    // 新增：多入参，入参类型丰富，复杂出参
    // 1. 传递用户ID、订单状态和时间区间，返回订单列表
    List<Order> queryOrders(Long userId, String status, java.time.LocalDateTime startTime,
            java.time.LocalDateTime endTime);

    // 2. 传递订单对象和操作人信息，返回操作结果对象
    OperationResult operateOrder(Order order, OperatorInfo operatorInfo);

    // 3. 传递订单ID列表和附加参数，返回订单ID到订单详情的映射
    java.util.Map<Long, OrderDetail> batchGetOrderDetails(java.util.List<Long> orderIds,
            java.util.Map<String, Object> extraParams);
}